Repository navigation
Conversation
Group equivalent pairs and reuse neighbor lists across small structure changes. Automatically sum all pairs for supported calculators and retain pair-by-pair evaluation for custom models and partitioned runs. Choose between an incremental update and a full sum based on the estimated work. Use per-site occupancies in Debye sums, preserve valid updates across adapter classes, and isolate calculator copies and concurrent evaluations. Split large CPU pair batches across workers and merge their private sums in range order. Choose one worker per 8192 pairs in large batches, up to the hardware concurrency reported by the system. Keep distinct floating-point distances and widths separate at cutoffs. Track site order across incremental updates and honor site-dependent scattering factors in derived Debye calculators. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
SYMSCAE
marked this pull request as ready for review
November 19, 2026 05:56
Contributor
Author
|
@sbillinge PR ready for review. For CI, I wonder if we have gpu machines enabled? (I think they're paid if we use github ones, or we can use other cloud providers). Codecov is currently not happy since I switched cuda build off for ci. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
PDFCalculatorandDebyePDFCalculatoradd pairs one at a time on a singlethread, so full PDF and Debye sums are slow for large structures and in
refinement loops. This PR speeds up those sums on the CPU and adds a CUDA backend.
CPU
PairQuantity::addAllPairContributions(). Derived calculators can implement itor reuse
addAllPairsOfPDF/addAllPairsOfDebyeSum.OPTIMIZEDnow estimates the cost of an incremental update against a fullsum and runs the full sum when it is clearly cheaper (requires a 15% margin
to absorb estimate error).
GPU
cuda(fp64) andcuda-mixed(fp32 sampling, fp64 distances and sums)kernels.
Fixes
DebyePDFCalculatoruses each site's own occupancy when several sites sharean element.
OPTIMIZEDrecalculates when a change of adapter class changes the structure.Benchmarks